package work02.w5.control;

import java.util.HashMap;
import java.util.Map;

import work02.w5.model.DateWithLunar;
import work02.w5.model.ScheduleModel;

/**
 * 用于判断当天是否为特殊节日
 */
public class SpecialDay {
    	Map<DateWithLunar, String> specialDayMap= new HashMap<DateWithLunar, String>();
//    var solarTerm = new Array("小寒","大寒","立春","雨水","惊蛰","春分","清明","谷雨","立夏","小满","芒种","夏至","小暑","大暑","立秋","处暑","白露","秋分","寒露","霜降","立冬","小雪","大雪","冬至")
//    var lFtv = new Array("0101*春节","0115 元宵节","0505 端午节","0707 七夕情人节","0715 中元节","0815 中秋节","0909 重阳节","1208 腊八节","1224 小年","0100*除夕")
//    var sFtv = new Array("0101*元旦","0214 情人节","0308 妇女节","0312 植树节","0315 消费者权益日","0401 愚人节","0404 Eric的生日","0501 劳动节","0504 青年节","0512 护士节","0601 儿童节","0701 建党节 香港回归纪念","0801 建军节","0808 父亲节","0909 毛席逝世纪念","0910 教师节","0928 孔子诞辰","1001*国庆节",
//    "1006 老人节","1024 联合国日","1112 孙中山诞辰","1220 澳门回归纪念","1225 圣诞节","1226 毛席诞辰")
	/**
	 * @param model
	 * @return
	 */
	public boolean isSpecialDay(DateWithLunar d){
		return specialDayMap.containsKey(d);
	}
	/**
	 * 
	 * @param d
	 * @return
	 */
	public String getSpecialDayName(DateWithLunar d){
		return specialDayMap.get(d);
	}
	/**
	 * 
	 * @param d
	 * @param name
	 * @return
	 */
	public String addSpecialDay(DateWithLunar d,String name){
		return specialDayMap.put(d, name);
	}
	/**
	 * 
	 * @param d
	 */
	public void removeSpecialDay(DateWithLunar d){
		specialDayMap.remove(d);
	}
}
